//
//  Constants.h
//  HuLaQuan
//
//  Created by hok on 1/5/16.
//  Copyright © 2016 Jianghao. All rights reserved.
//

#ifndef Constants_h
#define Constants_h


#endif /* Constants_h */

#define kCommonBlueColor 0x16b7e4

#define ServerMoneyToShow(value) [NSString stringWithFormat:@"%.f", [value integerValue]/100.0]
#define ServerMoneyFloatToShow(value) [NSString stringWithFormat:@"%.2f", [value integerValue]/100.0]

#define ConvertToServerMoney(value) [NSString stringWithFormat:@"%d", (int)([value floatValue] * 100)]

//SYSTEM AND DEVICE VERSION
#define DEVICE_NAME ([UIDevice currentDevice].name)
#define SYSTEM_VERSION ([[UIDevice currentDevice].systemVersion doubleValue])

//
#define SANDBOX_PATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]

// SCREEN SIZE
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_RETINA ([[UIScreen mainScreen] scale] >= 2.0)

#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))

//
#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)

//ERROR MESSAGE
#define TEXT_NETWORK_ERROR @"网络异常，请检查网络连接"
#define TEXT_SERVER_NOT_RESPOND @"服务器或网络异常,请稍后重试"

//LOADING MESSAGE
#define NETWORK_LOADING @"加载中..."

//APP INFO
#define APP_NAME @"HuLaQuan"
#define APP_ID @"AppName"
#define COPYRIGHT @"Copyright @2016 Jianghao All Rights Reserved"



typedef enum {
    BindingCard = 0,
    UnBindingCard,
    PayBill,
    Modify
} TypeOfCheckPasswordFor;

typedef enum {
    UserPassword = 0,          
    PayPassword
} YuPasswordType;

typedef enum{
    ZCControllerStyle = 0,
    ZCPresentStyle
}ZCViewStyle;



//Font
#define SCALE_FOR_SCREEN(floatValue)  (IS_IPHONE_4_OR_LESS ? floatValue/1.16 :(IS_IPHONE_5 ?  floatValue/1.14 : floatValue) )

#define SCALE_FOR_LARGE_SCREEN(floatValue)  (IS_IPHONE_4_OR_LESS ? floatValue/1.16 :(IS_IPHONE_5 ?  floatValue/1.14 :(IS_IPHONE_6? floatValue : floatValue*1.17 ) ) )

#define SCALE_FONT_FOR_SCREEN(intValue)  (IS_IPHONE_4_OR_LESS ? intValue   :(IS_IPHONE_5  ?  intValue   : (IS_IPHONE_6P? intValue + 2 :intValue +1) )

#define FONT_NAME @"FZLanTingHeiS-EL-GB"


